<%--
  Created by IntelliJ IDEA.
  User: zyj
  Date: 2021/12/24
  Time: 21:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<% request.setCharacterEncoding("UTF-8"); %>
<html>
<head>

    <!-- 引入谷歌库 -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:300,700">

    <!-- 引入font awesome图标库 -->
    <script src="https://kit.fontawesome.com/2449e59251.js" crossorigin="anonymous"></script>

    <!-- 引入Bootstrap3.3.0 -->
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">

    <!-- 引入layui css -->
    <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" />

    <!-- 引入本地css文件 -->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/teacher.css">

    <!-- 引入jquery -->
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>

    <!-- 引入bootstrap.js -->
    <script src="http://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

    <!-- 引入 layui.js -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/layui/2.6.8/layui.min.js"></script>

    <meta charset="utf-8">
    <title>教师首页</title>
</head>
<body>

<%--学生作业详情页面--%>

<div class="container">

    <div class="toolbar">
        <ul class="layui-nav" lay-filter="">
            <img src="${pageContext.request.contextPath}/static/img/logo_green.png" class="logo" />
            <li id="index" class="layui-nav-item"><a href="${pageContext.request.contextPath}/teacher/allMyClass">我的授课</a></li>
            <li id="grade" class="layui-nav-item layui-this"><a href="${pageContext.request.contextPath}/teacher/viewHomeworkList">批改作业</a></li>
            <li id="classes" class="layui-nav-item"><a href="${pageContext.request.contextPath}/teacher/submitGrade">上传成绩</a></li>

            <li class="toolbar_right"><a href="${pageContext.request.contextPath}/loginCheck/logOut">退出登录</a></li>
            <li class="toolbar_right">欢迎你！<span>${userId}</span> |</li>


        </ul>
    </div>

    <div class="item_content" style="height: 85vh;">

        <div class="col-md-12 tab_container_blue">

            <div class="tab_left_top_text" style="display: inline-block;">
                <p>作业详情</p>
                <p class="second_child">
                    <span class="text_span">${courseName} | ${homeworkTitle}</span>
                </p>
            </div>

        </div>

        <div class="col-md-12 grade_table">

            <form class="layui-form" action="${pageContext.request.contextPath}/teacher/updateHomeworkLevel" method="post">
                <input name="homeworkId" type="hidden" value="${homeworkId}">
                <input name="studentId" type="hidden" value="${studentId}">
                <input name="homeworkTitle" type="hidden" value="${homeworkTitle}">
                <input name="courseName" type="hidden" value="${courseName}">
                <input id="levle" type="hidden" value="${homeworkDetail.level}">
                <div class="layui-form-item layui-form-text">
                    <label class="layui-form-label">作答内容：</label>
                    <div class="layui-input-block">
                        <textarea name="desc" placeholder="在这里打印学生作业详情" class="layui-textarea">${homeworkDetail.theDetail}</textarea>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">分数：</label>
                    <div class="layui-input-block">
                        <input id="A" type="radio" name="sex" value="A" title="A">
                        <input id="B" type="radio" name="sex" value="B" title="B">
                        <input id="C" type="radio" name="sex" value="C" title="C">
                        <input id="D" type="radio" name="sex" value="D" title="D">
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="text-center">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                    </div>
                </div>

            </form>

        </div>

    </div>

</div>
<script type="text/javascript">
    // history.go(1);
    <%--let level = ${homeworkDetail.level};--%>
    let level = $("#levle").val();
    if(level == "A"){
        $("input:radio[value='A']").attr('checked','true');
    }else if(level == "B"){
        $("input:radio[value='B']").attr('checked','true');
    }else if(level == "C"){
        $("input:radio[value='C']").attr('checked','true');
    }else if(level == "D"){
        $("input:radio[value='D']").attr('checked','true');
    }
</script>
</body>
</html>
